package com.yfqy.app.enums;

import lombok.Getter;

@Getter
public enum RefundReason {

    /**
     * 与商家协商一致退款
     */
    AGREED_REFUND((byte) 1, "与商家协商一致退款"),

    /**
     * 产品损坏/包装问题
     */
    PRODUCT_DAMAGED((byte) 2, "产品损坏/包装问题"),

    /**
     * 快递还没有寄出
     */
    NOT_SHIPPED((byte) 3, "快递还没有寄出"),

    /**
     * 缺少物品/错过装运
     */
    MISSING_ITEMS((byte) 4, "缺少物品/错过装运"),

    /**
     * 价格下降/多付款
     */
    PRICE_DROP((byte) 5, "价格下降/多付款"),

    /**
     * 未按约定发运
     */
    NOT_SHIPPED_AS_AGREED((byte) 6, "未按约定发运"),

    /**
     * 其他原因
     */
    OTHER((byte) 7, "其他");

    private final byte reason;
    private final String reasonDesc;

    RefundReason(byte reason, String reasonDesc) {
        this.reason = reason;
        this.reasonDesc = reasonDesc;
    }

    public static String getReasonDesc(byte reason) {
        for (RefundReason afterSalesReason : values()) {
            if (afterSalesReason.getReason() == reason) {
                return afterSalesReason.getReasonDesc();
            }
        }
        return "";
    }

}
